/*
 * delay.c
 *
 *  Created on: 2021-5-1
 *      Author: yangx
 */

#include "delay.h"

void DelayMicroSecond(int val) {
	int len = 14;
	int i = 0;
	int j = 0;
	for (j = 0; j < val; j++) {
		for (i = 0; i < len; i++) {
			asm(" NOP ");
			asm(" NOP ");
			asm(" NOP ");
			asm(" NOP ");
			asm(" NOP ");
			asm(" NOP ");
			asm(" NOP ");
			asm(" NOP ");
		}
	}
}

void DelayMilliSecond(int val) {
	int j = 0;
	for (j = 0; j < val; j++) {
	  DelayMicroSecond(1000);
	}
}

void DelaySecond(int val) {
	int j = 0;
	for (j = 0; j < val; j++) {
		DelayMilliSecond(1000);
	}
}


